<template>
  <div class="right-main">
    <div class="tob-bar">
      <el-breadcrumb separator=">">
        <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
        <el-breadcrumb-item>编辑参保地</el-breadcrumb-item>
      </el-breadcrumb>
    </div>
    <div class="mainContainer addInsurePage">
      <el-tabs class="custom-tab" v-model="activeName">
        <el-tab-pane label="社保" name="shebao">
          <!-- 社保表单 -->
          <div class="customform shebaoform">
            <el-form
              :inline="true"
              label-width="120px"
              ref="policyaddr"
              label-position="left"
              :rules="rulesSocial"
              :model="policyAddr"
            >
              <div class="el-form--inline">
                <el-form-item label="参保地" prop="addr.addrName">
                  <el-input v-model="policyAddr.addr.addrName" placeholder="新参保地名称"></el-input>
                </el-form-item>
                <el-form-item label="所属城市">
                  <el-cascader
                    size="large"
                    :options="options"
                    v-model="selectedOptions"
                    @change="handleChange"
                  ></el-cascader>
                </el-form-item>
                <el-form-item label="年度首月">
                  <el-select v-model="policyAddr.social.areaFirstMonth" placeholder="年度首月">
                    <el-option :label="item+'月'" :value="item" v-for=" item in 12 " :key="item"></el-option>
                    <!--<el-option label="2月" value="2"></el-option>-->
                  </el-select>
                </el-form-item>
              </div>
              <div class="el-form--inline">
                <el-form-item label="减员周期">
                  <data-dict-select
                    :dataKey="20002"
                    :p_value.sync="policyAddr.social.jyTbCycleCode"
                    :p_name.sync="policyAddr.social.jyTbCycleName"
                  ></data-dict-select>
                </el-form-item>
                <el-form-item label="增员周期">
                  <data-dict-select
                    :dataKey="20001"
                    :p_value.sync="policyAddr.social.zyTbCycleCode"
                    :p_name.sync="policyAddr.social.zyTbCycleName"
                  ></data-dict-select>
                </el-form-item>
                <el-form-item label="滞纳金比例" prop="social.overdueFineRatio">
                  <el-input type="number" v-model="policyAddr.social.overdueFineRatio" placeholder="滞纳金比例">
                    <i class="el-input__icon" slot="suffix">%</i>
                  </el-input>
                </el-form-item>
              </div>
              <div class="el-form--inline">
                <el-form-item label="增员截止日期">
                  <el-select v-model="policyAddr.social.zyEndDay" placeholder="请选择">
                    <el-option :label="item+'号'" v-for="item in 31" :value="item" :key="item"></el-option>
                  </el-select>
                </el-form-item>
                <el-form-item label="减员截止日期">
                  <el-select v-model="policyAddr.social.jyEndDay" placeholder="请选择">
                    <el-option :label="item+'号'" v-for="item in 31" :value="item" :key="item"></el-option>
                  </el-select>
                </el-form-item>
                <el-form-item label="一月内多次增减">
                  <el-checkbox v-model="socialSecTime" @change="socialSecTime1=!socialSecTime1">允许</el-checkbox>
                  <el-checkbox v-model="socialSecTime1" @change="socialSecTime=!socialSecTime">不允许</el-checkbox>
                </el-form-item>
              </div>
            </el-form>
          </div>
          <!-- 社保表单结束 -->
        </el-tab-pane>
        <el-tab-pane label="公积金" name="gongjijin">
          <div class="customform shebaoform">
            <el-form
              :inline="true"
              label-width="120px"
              label-position="left"
              :rules="rulesAccfund"
              :model="policyAddr"
              ref="policyaddr"
            >
              <div class="el-form--inline">
                <el-form-item label="参保地" prop="addr.addrName">
                  <el-input v-model="policyAddr.addr.addrName" placeholder="新参保地名称"></el-input>
                </el-form-item>
                <el-form-item label="所属城市">
                  <el-cascader
                    size="large"
                    :options="options"
                    v-model="selectedOptions"
                    @change="handleChange"
                  ></el-cascader>

                  <!--<provincecity class="city-select" ref="addFormProvince" :provinceId="cityData.provinceId" :val="cityData" @change="getCityData"></provincecity>-->
                </el-form-item>
                <el-form-item label="年度首月">
                  <el-select v-model="policyAddr.social.areaFirstMonth" placeholder="年度首月">
                    <el-option :label="item+'月'" :value="item" v-for=" item in 12 " :key="item"></el-option>
                  </el-select>
                </el-form-item>
              </div>
              <div class="el-form--inline">
                <el-form-item label="减员周期">
                  <data-dict-select
                    :dataKey="20002"
                    :p_value.sync="policyAddr.accfund.jyTbCycleCode"
                    :p_name.sync="policyAddr.accfund.jyTbCycleName"
                  ></data-dict-select>
                </el-form-item>
                <el-form-item label="增员周期">
                  <data-dict-select
                    :dataKey="20001"
                    :p_value.sync="policyAddr.accfund.zyTbCycleCode"
                    :p_name.sync="policyAddr.accfund.zyTbCycleName"
                  ></data-dict-select>
                </el-form-item>
                <el-form-item label="滞纳金比例" prop="accfund.overdueFineRatio">
                  <el-input v-model="policyAddr.accfund.overdueFineRatio" placeholder="滞纳金比例">
                    <i class="el-input__icon" slot="suffix">%</i>
                  </el-input>
                </el-form-item>
              </div>
              <div class="el-form--inline">
                <el-form-item label="增员截止日期">
                  <el-select v-model="policyAddr.accfund.zyEndDay" placeholder="请选择">
                    <el-option :label="item+'号'" v-for="item in 31" :value="item" :key="item"></el-option>
                  </el-select>
                </el-form-item>
                <el-form-item label="减员截止日期">
                  <el-select v-model="policyAddr.accfund.jyEndDay" placeholder="请选择">
                    <el-option :label="item+'号'" v-for="item in 31" :value="item" :key="item"></el-option>
                  </el-select>
                </el-form-item>
                <el-form-item label="一月内多次增减">
                  <el-checkbox
                    v-model="accfundSecTime"
                    @change="accfundSecTime1=!accfundSecTime1"
                  >允许</el-checkbox>
                  <el-checkbox
                    v-model="accfundSecTime1"
                    @change="accfundSecTime=!accfundSecTime"
                  >不允许</el-checkbox>
                </el-form-item>
              </div>
            </el-form>
          </div>
        </el-tab-pane>
      </el-tabs>
    </div>

    <!-- 第二个tab模块 -->
    <div class="mainContainer m-t20">
      <el-tabs class="custom-tab" v-model="activeName2">
        <el-tab-pane label="增员资料" name="zyzl">
          <!-- 增员资料 -->
          <div class="zy-form my-table">
            <template>
              <el-table :data="infiledList.zyData" style="width: 100%">
                <el-table-column align="center" type="index" label="序号"></el-table-column>
                <el-table-column align="center" prop="fileName" label="资料名称" style="width:6vw;">
                  <template slot-scope="scope">
                    <data-dict-select
                      :dataKey="30001"
                      :p_value.sync="scope.row.name"
                      :p_name.sync="scope.row.nameValue"
                    ></data-dict-select>
                  </template>
                </el-table-column>
                <el-table-column align="center" prop="fileType" label="资料类型">
                  <template slot-scope="scope">
                    <data-dict-select
                      :dataKey="30002"
                      :p_value.sync="scope.row.contentType"
                      :p_name.sync="scope.row.contentTypeName"
                    ></data-dict-select>
                  </template>
                </el-table-column>
                <el-table-column align="center" prop="orNo" label="是否必要">
                  <template slot-scope="scope">
                    <el-select v-model="scope.row.required" clearable>
                      <el-option
                        v-for="item in orNos"
                        :key="item.value"
                        :label="item.text"
                        :value="item.value"
                      ></el-option>
                    </el-select>
                  </template>
                </el-table-column>
                <el-table-column align="center" prop="remarks" label="备注">
                  <template slot-scope="scope">
                    <el-input v-model="scope.row.comment" maxlength="255" show-word-limit></el-input>
                  </template>
                </el-table-column>
                <el-table-column align="center" prop="tools" label="操作" width="180">
                  <template slot-scope="scope">
                    <template v-if="true">
                      <!-- <el-button type="text">
                        <i class="iconfont iconedit"></i>
                      </el-button>-->
                      <el-button
                        size="mini"
                        type="text"
                        @click.native.prevent="deleteRow(scope.$index, infiledList.zyData)"
                      >
                        <i class="iconfont icondelet text-danger"></i>
                      </el-button>
                    </template>
                    <template v-if="false">
                      <el-button type="text">
                        <i class="iconfont iconcheck-no"></i>
                      </el-button>
                      <el-button size="mini" type="text">
                        <i class="iconfont iconcheck-r text-danger"></i>
                      </el-button>
                    </template>
                  </template>
                </el-table-column>
              </el-table>
            </template>
            <div class="clearfix">
              <el-button class="fr table-add-btn" size="small" @click="addRow(infiledList.zyData)">
                <i class="iconfont iconadd"></i> 添加资料
              </el-button>
            </div>
          </div>
          <!-- 增员资料结束 -->
        </el-tab-pane>
        <el-tab-pane label="减员资料" name="jyzl">
          <div class="zy-form my-table">
            <template>
              <el-table :data="infiledList.jyData" style="width: 100%">
                <el-table-column align="center" type="index" label="序号"></el-table-column>
                <el-table-column align="center" prop="fileName" label="资料名称" style="width:6vw;">
                  <template slot-scope="scope">
                    <data-dict-select
                      :dataKey="30001"
                      :p_value.sync="scope.row.name"
                      :p_name.sync="scope.row.nameValue"
                    ></data-dict-select>
                  </template>
                </el-table-column>
                <el-table-column align="center" prop="fileType" label="资料类型">
                  <template slot-scope="scope">
                    <data-dict-select
                      :dataKey="30002"
                      :p_value.sync="scope.row.contentType"
                      :p_name.sync="scope.row.contentTypeName"
                    ></data-dict-select>
                  </template>
                </el-table-column>
                <el-table-column align="center" prop="orNo" label="是否必要">
                  <template slot-scope="scope">
                    <el-select v-model="scope.row.required" clearable>
                      <el-option
                        v-for="item in orNos"
                        :key="item.value"
                        :label="item.text"
                        :value="item.value"
                      ></el-option>
                    </el-select>
                  </template>
                </el-table-column>
                <el-table-column align="center" prop="remarks" label="备注">
                  <template slot-scope="scope">
                    <el-input v-model="scope.row.comment" maxlength="255" show-word-limit></el-input>
                  </template>
                </el-table-column>
                <el-table-column align="center" prop="tools" label="操作" width="180">
                  <template slot-scope="scope">
                    <template v-if="true">
                      <!-- <el-button type="text">
                        <i class="iconfont iconedit"></i>
                      </el-button>-->
                      <el-button
                        size="mini"
                        type="text"
                        @click.native.prevent="deleteRow(scope.$index, infiledList.jyData)"
                      >
                        <i class="iconfont icondelet text-danger"></i>
                      </el-button>
                    </template>
                    <template v-if="false">
                      <el-button type="text">
                        <i class="iconfont iconcheck-no"></i>
                      </el-button>
                      <el-button size="mini" type="text">
                        <i class="iconfont iconcheck-r text-danger"></i>
                      </el-button>
                    </template>
                  </template>
                </el-table-column>
              </el-table>
            </template>
            <div class="clearfix">
              <el-button
                class="fr table-add-btn"
                size="small"
                @click="addRow(infiledList.jyData,0,0)"
              >
                <i class="iconfont iconadd"></i> 添加资料
              </el-button>
            </div>
          </div>
        </el-tab-pane>
        <el-tab-pane label="补缴资料" name="bjzl">
          <div class="zy-form my-table">
            <template>
              <el-table :data="infiledList.bjData" style="width: 100%">
                <el-table-column align="center" type="index" label="序号"></el-table-column>
                <el-table-column align="center" prop="fileName" label="资料名称" style="width:6vw;">
                  <template slot-scope="scope">
                    <data-dict-select
                      :dataKey="30001"
                      :p_value.sync="scope.row.name"
                      :p_name.sync="scope.row.nameValue"
                    ></data-dict-select>
                  </template>
                </el-table-column>
                <el-table-column align="center" prop="fileType" label="资料类型">
                  <template slot-scope="scope">
                    <data-dict-select
                      :dataKey="30002"
                      :p_value.sync="scope.row.contentType"
                      :p_name.sync="scope.row.contentTypeName"
                    ></data-dict-select>
                  </template>
                </el-table-column>
                <el-table-column align="center" prop="orNo" label="是否必要">
                  <template slot-scope="scope">
                    <el-select v-model="scope.row.required" clearable>
                      <el-option
                        v-for="item in orNos"
                        :key="item.value"
                        :label="item.text"
                        :value="item.value"
                      ></el-option>
                    </el-select>
                  </template>
                </el-table-column>
                <el-table-column align="center" prop="remarks" label="备注">
                  <template slot-scope="scope">
                    <el-input v-model="scope.row.comment" maxlength="255" show-word-limit></el-input>
                  </template>
                </el-table-column>
                <el-table-column align="center" prop="tools" label="操作" width="180">
                  <template slot-scope="scope">
                    <template v-if="true">
                      <!-- <el-button type="text">
                        <i class="iconfont iconedit"></i>
                      </el-button>-->
                      <el-button
                        size="mini"
                        type="text"
                        @click.native.prevent="deleteRow(scope.$index, infiledList.bjData)"
                      >
                        <i class="iconfont icondelet text-danger"></i>
                      </el-button>
                    </template>
                    <template v-if="false">
                      <el-button type="text">
                        <i class="iconfont iconcheck-no"></i>
                      </el-button>
                      <el-button size="mini" type="text">
                        <i class="iconfont iconcheck-r text-danger"></i>
                      </el-button>
                    </template>
                  </template>
                </el-table-column>
              </el-table>
            </template>
            <div class="clearfix">
              <el-button
                class="fr table-add-btn"
                size="small"
                @click="addRow(infiledList.bjData,0,0)"
              >
                <i class="iconfont iconadd"></i> 添加资料
              </el-button>
            </div>
          </div>
        </el-tab-pane>
      </el-tabs>
    </div>
    <!-- 第二个tab模块结束 -->
    <div class="page-form-btn">
      <el-button @click="$router.go(-1)">取消</el-button>
      <el-button type="primary" @click="save" v-show="flag">保存</el-button>
    </div>
  </div>
</template>

<script>
import Http from "../../libs/http.js";
import {
  provinceAndCityData,
  CodeToText,
  TextToCode
} from "element-china-area-data";
import dataDictSelect from "../../components/DataDictSelect";
export default {
  name: "edit",
  components: { dataDictSelect },
  data() {
    var validateOverdueFineRatio = (rule, value, callback) => {
      var pattern = /^\d+.?\d{0,2}$/;
      if (value < 0 || value > 100) {
        return callback(new Error("请输入0-100值"));
      } else if (!pattern.test(value)) {
        return callback(new Error("输入数字或小数点后最多只能输入两位"));
      } else return callback();
    };
    const isSelect = (rule, value, callback) => {
      if (value === undefined || value.length == 0) {
        //如果值是 0，提示用户选择正确的选项
        return callback(new Error("请选择所属城市"));
      } else {
        callback();
      }
    };
    return {
      rulesSocial: {
        "social.overdueFineRatio": [
          { validator: validateOverdueFineRatio, trigger: "blur" }
        ],
        "addr.addrName": [
          {
            required: true,
            message: "请输入参保地",
            trigger: ["blur", "change"]
          },
          {
            max: 255,
            message: "不能超过255个字符",
            trigger: ["blur", "change"]
          }
        ]
      },
      rulesAccfund: {
        "accfund.overdueFineRatio": [
          { validator: validateOverdueFineRatio, trigger: "blur" }
        ],
        "addr.addrName": [
          {
            required: true,
            message: "请输入参保地",
            trigger: ["blur", "change"]
          },
          {
            max: 255,
            message: "不能超过255个字符",
            trigger: ["blur", "change"]
          }
        ]
      },
      flag: true,
      datumType1: {
        zyzl: 0,
        jyzl: 1,
        bjzl: 2
      },
      policyType: {
        shebao: 0,
        gongjijin: 1
      },
      socialSecTime: false,
      socialSecTime1: true,
      accfundSecTime: false,
      accfundSecTime1: true,
      options: provinceAndCityData,
      selectedOptions: ["", ""],
      datumType: {
        zyzl: "zyData",
        jyzl: "jyData",
        bjzl: "bjData"
      },
      id: null,
      activeName: "shebao",
      activeName2: "zyzl",
      // 社保表单
      policyAddr: {
        datumList: [],
        //参保地基本信息
        addr: {
          provinceName: null,
          cityName: null,
          addrName: null
        },
        //社保政策
        social: {
          overdueFineRatio: 0,
          zyTbCycleCode: null,
          jyTbCycleCode: null,
          tjTbCycleCode: null,
          zyTbCycleName: "",
          jyTbCycleName: "",
          tjTbCycleName: "",
          zyEndDay: null,
          jyEndDay: null,
          areaFirstMonth: 1,
          isAllowAgainZjy: 0,
          hasSecondTime: 0,
          dataNum: {
            zyData: [],
            jyData: [],
            bjData: []
          }
        },
        //公积金政策
        accfund: {
          overdueFineRatio: "",
          zyTbCycleCode: "",
          jyTbCycleCode: "",
          tjTbCycleCode: "",
          zyTbCycleName: "",
          jyTbCycleName: "",
          tjTbCycleName: "",
          zyEndDay: "",
          jyEndDay: "",
          areaFirstMonth: null,
          isAllowAgainZjy: 0,
          hasSecondTime: 0,
          dataNum: {
            zyData: [],
            jyData: [],
            bjData: []
          }
        }
      },
      infiledList: {},
      // 增员资料
      datumList: {
        shebao: {
          zyData: [],
          jyData: [],
          bjData: []
        },
        gongjijin: {
          zyData: [],
          jyData: [],
          bjData: []
        }
      },
      fileNames: [{ text: "身份证", value: "1" }, { text: "照片", value: "2" }],
      fileTypes: [
        { text: "原件", value: "1" },
        { text: "电子扫描", value: "2" }
      ],
      orNos: [{ text: "是", value: 1 }, { text: "否", value: 0 }]
    };
  },
  created() {
    this.init();
  },
  watch: {
    activeName(val) {
      this.infiledList = this.datumList[val];
      this.activeName2 = "zyzl";
    },
    accfundSecTime(val) {
      this.policyAddr.accfund.hasSecondTime = val ? 1 : 0;
    },
    socialSecTime(val) {
      this.policyAddr.social.hasSecondTime = val ? 1 : 0;
    }
  },
  methods: {
    init() {
      Http.api.get("addr/" + this.$route.query.id).then(res => {
        this.selectedOptions = [];
        this.policyAddr = res.data;
        this.initDatum(res.data.datumList);
        this.selectedOptions.push(
          TextToCode[this.policyAddr.addr.provinceName].code
        );
        this.selectedOptions.push(
          TextToCode[this.policyAddr.addr.provinceName][
            this.policyAddr.addr.cityName
          ].code
        );

        this.socialSecTime = this.policyAddr.social.hasSecondTime == 1;
        this.socialSecTime1 = this.policyAddr.social.hasSecondTime == 0;
        if(this.socialSecTime === this.socialSecTime1){
          this.socialSecTime = true ;
          this.socialSecTime1 = false ;

        }
        this.accfundSecTime = this.policyAddr.accfund.hasSecondTime == 1;
        this.accfundSecTime1 = this.policyAddr.accfund.hasSecondTime == 0;
        if(this.accfundSecTime === this.accfundSecTime1){
          this.accfundSecTime = true ;
          this.accfundSecTime1 = false ;

        }
      });
    },
    initDatum(list) {
      console.log(list);
      this.datumList = {
        shebao: {
          zyData: [],
          jyData: [],
          bjData: []
        },
        gongjijin: {
          zyData: [],
          jyData: [],
          bjData: []
        }
      };
      list.forEach(e => {
        console.log(e);
        if (e.policyType == 0) {
          switch (e.changeType) {
            case 0:
              this.datumList.shebao.zyData.push(e);
              break;
            case 1:
              this.datumList.shebao.jyData.push(e);
              break;
            case 2:
              this.datumList.shebao.bjData.push(e);
              break;
          }
        } else {
          switch (e.changeType) {
            case 0:
              this.datumList.gongjijin.zyData.push(e);
              break;
            case 1:
              this.datumList.gongjijin.jyData.push(e);
              break;
            case 2:
              this.datumList.gongjijin.bjData.push(e);
              break;
          }
        }
      });
      this.infiledList = this.datumList[this.activeName];
      console.log(this.infiledList);
    },
    //删除改行
    deleteRow(index, rows) {
      let s = rows[index];
      this.policyAddr.datumList.splice(this.policyAddr.datumList.indexOf(s), 1);
      rows.splice(index, 1);
    },
    // 添加行
    addRow(listData) {
      console.log(this.activeName2, this.activeName);
      let d = this.generateData();
      d.policyType = this.policyType[this.activeName];
      d.changeType = this.datumType1[this.activeName2];
      this.policyAddr.datumList.push(d);
      this.initDatum(this.policyAddr.datumList);
      // console.log(this.policyAddr.dataNums)
    },
    // 保存
    save() {
      this.$refs["policyaddr"].validate(v => {
        if (v) {
          if(!this.checkNameAndTypes()) {
            return false;
          }
          this.flag = false;
          Http.api
            .put("addr/" + this.$route.query.id, this.policyAddr)
            .then(res => {
              this.resetAddr();
              this.$message({
                message: "数据已保存",
                center: true,
                iconClass: "iconfont iconcheck",
                customClass: "custom-message"
              });
              this.$router.push({ path: "/policy/list" });
            });
        } else {
          this.$alert("内容不完整，请重新输入", "提示", {
            confirmButtonText: "确定"
          });
          return false;
        }
      });
      //this.createDataum();
    },
    //生成资料
    generateData() {
      return {
        policyType: 0,
        changeType: 0,
        type: 0,
        name: null,
        comment: "",
        contentType: "",
        required: 0
      };
    },
    handleChange(res) {
      console.log(this.selectedOptions);
      this.policyAddr.addr.provinceName = CodeToText[res[0]];
      this.policyAddr.addr.cityName = CodeToText[res[1]];
    },

    checkNameAndTypes(){
      console.log('xx')
      if(!this.checkNameAndType(this.datumList.gongjijin.bjData,"公积金","补缴")){
        return false ;
      }
      if(!this.checkNameAndType(this.datumList.gongjijin.jyData,"公积金","减员")){
        return false ;
      }
      if(!this.checkNameAndType(this.datumList.gongjijin.zyData,"公积金","增员")){
        return false ;
      }
      if(!this.checkNameAndType(this.datumList.shebao.bjData,"社保","补缴")){
        return false ;
      }
      if(!this.checkNameAndType(this.datumList.shebao.jyData,"社保","减员")){
        return false ;
      }
      if(!this.checkNameAndType(this.datumList.shebao.zyData,"社保","增员")){
        return false ;
      }
      return true;

    },
    checkNameAndType(data,policyType,changeType){
      var a= new Array();
      for (let i in data){
        let item = data[i];
        if(item.name=="" || item.contentType == ""){
          this.$message.error(policyType+"["+changeType+"]：资料信息不能为空");
          return false ;
        }
        let key = item.name+item.contentType ;
        if(a.indexOf(key)==-1){
          a.push(key)
        }else{
          this.$message.error(policyType+"["+changeType+"]：资料重复");
          return false ;
        }
      }
      return true ;
    },

    /**
     * 重置数据
     */
    resetAddr() {
      this.policyAddr = {
        dataNums: [],
        //参保地基本信息
        addr: {
          provinceName: null,
          cityName: null,
          addrName: null
        },
        //社保政策
        social: {
          overdueFineRatio: null,
          zyTbCycleCode: null,
          jyTbCycleCode: null,
          tjTbCycleCode: null,
          zyEndDay: null,
          jyEndDay: null,
          areaFirstMonth: 1,
          isAllowAgainZjy: 0,
          hasSecondTime: 0,
          dataNum: {
            zyData: [],
            jyData: [],
            bjData: []
          }
        },

        //公积金政策
        accfund: {
          overdueFineRatio: "",
          zyTbCycleCode: "",
          jyTbCycleCode: "",
          tjTbCycleCode: "",
          zyEndDay: "",
          jyEndDay: "",
          areaFirstMonth: null,
          isAllowAgainZjy: 0,
          hasSecondTime: 0,
          dataNum: {
            zyData: [],
            jyData: [],
            bjData: []
          }
        }
      };
    },
    /**
     * 数据提交前资料合并
     */
    createDataum() {
      this.policyAddr.accfund.dataNum.bjData.forEach(e => {
        this.policyAddr.dataNums.push(e);
      });
      this.policyAddr.accfund.dataNum.jyData.forEach(e => {
        this.policyAddr.dataNums.push(e);
      });
      this.policyAddr.accfund.dataNum.zyData.forEach(e => {
        this.policyAddr.dataNums.push(e);
      });
      this.policyAddr.social.dataNum.bjData.forEach(e => {
        this.policyAddr.dataNums.push(e);
      });
      this.policyAddr.social.dataNum.jyData.forEach(e => {
        this.policyAddr.dataNums.push(e);
      });
      this.policyAddr.social.dataNum.zyData.forEach(e => {
        this.policyAddr.dataNums.push(e);
      });
    }
  }
};
</script>
